﻿
using ZR.Model.Models.ProductionControl;

namespace ZR.Model.Dto.Business.ProductionControl
{
    /// <summary>
    /// 打包任务查询对象
    /// </summary>
    public class CksPackagingTaskQueryDto : PagerInfo
    {
        public string TaskNo { get; set; }

        public DateTime? BeginTime { get; set; }
        public DateTime? EndTime { get; set; }
    }

    /// <summary>
    /// 打包任务输入输出对象
    /// </summary>
    public class CksPackagingTaskDto
    {
        [Required(ErrorMessage = "Id不能为空")]
        public long Id { get; set; }

        [Required(ErrorMessage = "任务编号不能为空")]
        public string TaskNo { get; set; }

        [Required(ErrorMessage = "流转容器编号不能为空")]
        public string ContainerNo { get; set; }

        [Required(ErrorMessage = "面单号不能为空")]
        public string WaybillNo { get; set; }

        [Required(ErrorMessage = "订单号不能为空")]
        public string OrderNo { get; set; }

        [Required(ErrorMessage = "包裹号不能为空")]
        public string PackageNo { get; set; }

        [Required(ErrorMessage = "禁用(无效)状态不能为空")]
        public bool Nullity { get; set; }

        [Required(ErrorMessage = "创建时间不能为空")]
        public DateTime? CreatedTime { get; set; }

        [Required(ErrorMessage = "是否删除不能为空")]
        public bool IsDeleted { get; set; }



        [ExcelColumn(Name = "是否删除")]
        public string IsDeletedLabel { get; set; }

        public DateTime? InTime { get; set; }

        public DateTime? OutTime { get; set; }
        /// <summary>
        /// 最后上传时间
        /// </summary>
        public DateTime? UploadTime { get; set; }
        public bool CanUpload { get; set; }
        /// <summary>
        /// 上传状态 0 未开始 1成功 2失败
        /// </summary>
        public int UploadStatus { get; set; }
        /// <summary>
        /// 时长:秒
        /// </summary>
        public int Duration { get; set; }

        [Column(MapType = typeof(int))]
        public TaskStatusType TaskStatus { get; set; }


        public string TaskStatusLabel
        {
            get { return TaskStatus.ToString(); }
        }

        /// <summary>
        /// 包裹位置
        /// </summary>
        public string Position { get; set; } = string.Empty;
    }
}